#include <stdio.h>
#include <unistd.h>

int main(int argc, char* argv[])
{   
    char pids[32] = {0};
    char* const ps_argv[] = {"pstree", "-A", "-p", "-s", pids, NULL};
    char* const ps_envp[] = {"PATH=/bin:/usr/bin", "TEST=Delphi", NULL};
    
    sprintf(pids, "%d", getpid());
    
    execl("/bin/pstree", "pstree", "-A", "-p", "-s", pids, NULL);
    // execlp("pstree", "pstree", "-A", "-p", "-s", pids, NULL);
    // execle("/bin/pstree", "pstree", "-A", "-p", "-s", pids, NULL, ps_envp);
    // execv("/bin/pstree", ps_argv);
    // execvp("pstree", ps_argv);
    // execve("/bin/pstree", ps_argv, ps_envp);
    
    return 0;
}
